<template>
	<upper-navigation>我的</upper-navigation>
	<view id="MyInfor">
		<view class="circle-img" :style="{ backgroundImage: `url(${user.avatar})` }"></view>
		<view class="user-area">
			<view class="left-text">
				用户名
				<br>
				{{ user.nickName }}
			</view>
			<view class="right-point" @click="toProfile">
				个人信息
			</view>
		</view>
		<view class="under-place">
			<navigator class="line-st" :url="'../Community/MyCommunity?id='">
				<view class="title">我的帖子</view>
				<view class="right-btn">&gt</view>
			</navigator>
			<navigator class="line-st" url="../Community/LinSearchRoot">
				<view class="title">族谱寻根</view>
				<view class="right-btn">&gt</view>
			</navigator>
			<!-- <navigator class="line-st">
				<view class="title">联系我们</view>
				<view class="right-btn">&gt</view>
			</navigator> -->
		</view>
		<image src="https://www.lin-home.com/static/Community/rootBackImg.png" class="bg-img"></image>
	</view>
	<bottom-bar></bottom-bar>
</template>

<script>
	//朱熙然 @ 4月30日 页面
	//姚珅 @ 5月18日 顶部底部导航组件添加
	import bottomBar from '@/pages/Community/bottomNavigationBar.vue'
	import upperNavigation from '@/pages/Community/upperNavigation.vue'
	import {
		useCurrentUser
	} from '@/stores/useUser.js'
	const currentUser = useCurrentUser();
	export default {
		components: {
			bottomBar,
			upperNavigation
		},
		methods: {
			toProfile() {
				uni.navigateTo({
					url: './Personal'
				});
			}
		},
		data() {
			return {
				user: currentUser.user
			}
		},
		async mounted() {
			await currentUser.getUserInfo();
		}
	}
</script>

<style lang="less">
	@import url(../Community/shared.less);
	@content-size: 25rpx;

	#MyInfor {
		padding: 0 30rpx;

		.circle-img {
			width: 130rpx;
			height: 130rpx;
			margin: 50rpx auto;
			border-radius: 50%;
			background: url("https://www.lin-home.com/api/holder/img10x10") 50% 50% / cover;
		}

		.user-area {
			width: 100%;
			height: 200rpx;
			margin: 0 auto;
			background-color: #EBF3F8;
			border-radius: 25rpx;
			padding: 50rpx;
			box-sizing: border-box;
			display: flex;

			.left-text {
				font-size: 35rpx;
				flex: 1;
			}

			.right-point {
				width: 250rpx;
				height: 65rpx;
				background-color: #707092;
				border-radius: 25rpx;
				margin: auto 0;
				text-align: center;
				color: #fff;
				line-height: 65rpx;
			}
		}

		.under-place {
			padding: 50rpx;

			.line-st {
				width: 100%;
				height: 100rpx;
				display: flex;
				border-bottom: 1rpx solid #d4c4c4;

				.title {
					flex: 1;
					line-height: 100rpx;
					font-size: 30rpx;
				}

				.right-btn {
					line-height: 100rpx;
					font-size: 40rpx;
				}
			}
		}

		.bg-img {
			position: absolute;
			bottom: 100rpx;
			left: 200rpx;
			z-index: -1;
		}
	}
</style>